package com.bw.myrouter_api;

import android.content.Context;
import android.os.Bundle;

/**
 * 路由请求
 */
public class RouterRequest {
    private String path;
    private Bundle bundle;

    public String getPath() {
        return path;
    }

    public Bundle getBundle() {
        return bundle;
    }

    public void setBundle(Bundle bundle) {
        this.bundle = bundle;
    }

    public void setPath(String path) {
        this.path = path;
    }

    public RouterRequest(String path) {
        this.path = path;
        this.bundle = new Bundle();
    }

    public RouterRequest withString(String key, String value) {
        bundle.putString(key, value);
        return this;
    }

    public RouterRequest withInt(String key, int value) {
        bundle.putInt(key, value);
        return this;
    }

    // navigation 方法
    public void navigation(Context context) {
        MyRouter.navigation(context, this);
    }
}
